import Vue from 'vue';
import Router from 'vue-router';
import config from "../../config/index.js";
const loginPage = resolve => require(['@/page/common/login-page'], resolve);
const rechargePassword = resolve => require(['@/page/common/recharge-password'], resolve)
const home = resolve => require(['@/page/home'], resolve);
const myCalendar = resolve => require(['@/page/myCalendar'], resolve);

//合作伙伴
const company = resolve => require(['@/page/partner/company'], resolve);
const moneyDetail = resolve => require(['@/page/partner/moneyDetail'], resolve);
const money = resolve => require(['@/page/partner/money'], resolve);
const channel = resolve => require(['@/page/partner/channel'], resolve);
const channelDetail = resolve => require(['@/page/partner/channelDetail'], resolve);
const user = resolve => require(['@/page/partner/user'], resolve);
const companyDetail = resolve => require(['@/page/partner/companyDetail'], resolve);
const companyPrimaryDetail = resolve => require(['@/page/partner/companyPrimaryDetail'], resolve);
const companyPrimaryDetailEdit = resolve => require(['@/page/partner/companyPrimaryDetailEdit'], resolve);
const equityList = resolve => require(['@/page/partner/equityList'], resolve);
const questionList = resolve => require(['@/page/partner/questionList'], resolve);
const businessPlan = resolve => require(['@/page/partner/businessPlan'], resolve);
const userLoan = resolve => require(['@/page/partner/userLoan'], resolve);
// const financeDetail = resolve => require(['@/page/partner/financeDetail'], resolve);
const stockList = resolve => require(['@/page/partner/stockList'], resolve);
const financialInfoV2 = resolve => require(['@/page/partner/financialInfo_v2'], resolve)
const financialReportAnalysis = resolve => require(['@/page/partner/financialReportAnalysis'], resolve)
const financialProfit = resolve => require(['@/page/partner/financialProfit'], resolve)
const financialBalance = resolve => require(['@/page/partner/financialBalance'], resolve)
const financialCashflow = resolve => require(['@/page/partner/financialCashflow'], resolve)
const financialOther = resolve => require(['@/page/partner/financialOther'], resolve)
const financialBalanceEdit = resolve => require(['@/page/partner/financialBalanceEdit'], resolve)
const financialReportAnalysisEdit = resolve => require(['@/page/partner/financialReportAnalysisEdit'], resolve)
const financeOperatingEdit = resolve => require(['@/page/partner/financeOperatingEdit'], resolve)
const financeInfoEdit = resolve => require(['@/page/partner/financeInfoEdit'], resolve)



//借贷需求
const product = resolve => require(['@/page/loan/product'], resolve);
const productEdit = resolve => require(['@/page/loan/productEdit'], resolve);
const productDetail = resolve => require(['@/page/loan/productDetail'], resolve);
//融资审核
const firstCheck = resolve => require(['@/page/check/firstCheck'], resolve);
const firstCheckEdit = resolve => require(['@/page/check/firstCheckEdit'], resolve);
const firstCheckDetail = resolve => require(['@/page/check/firstCheckDetail'], resolve);
const availableOrder = resolve => require(['@/page/check/availableOrder'], resolve);
const sentOrder = resolve => require(['@/page/check/sentOrder'], resolve);
const sentOrderDetail = resolve => require(['@/page/check/sentOrderDetail'], resolve);
const afterLoan = resolve => require(['@/page/check/afterLoan'], resolve);
const availableOrderDetail = resolve => require(['@/page/check/availableOrderDetail'], resolve);


//材料管理
const list = resolve => require(['@/page/material/list'], resolve)
const materialListDetail = resolve => require(['@/page/material/detail'], resolve)

//运营管理
const bannerSet = resolve => require(['@/page/operate/bannerSet'], resolve)
const bannerEdit = resolve => require(['@/page/operate/bannerEdit'], resolve)

//系统权限
const roleSet = resolve => require(['@/page/system/roleSet'], resolve)
const userSet = resolve => require(['@/page/system/userSet'], resolve)
const roleList = resolve => require(['@/page/system/roleList'], resolve)
const roleEdit = resolve => require(['@/page/system/roleEdit'], resolve)
const accountList = resolve => require(['@/page/system/accountList'], resolve)
const accountEdit = resolve => require(['@/page/system/accountEdit'], resolve)


Vue.use(Router)

export default new Router({
    mode: 'history',
    base: config.webType == 'test' ? '/sys/' : '',
    routes: [{
            path: '/loginPage',
            name: 'loginPage',
            component: loginPage
        },
        {
            path: '/rechargePassword',
            name: 'rechargePassword',
            component: rechargePassword
        },
        {
            path: '/',
            name: 'home',
            component: home
        },
        {
            path: '/myCalendar',
            name: 'myCalendar',
            component: myCalendar,
        },
        {
            path: '/partner/company',
            name: 'company',
            component: company,
        },
        {
            path: '/partner/money',
            name: 'money',
            component: money,
        },
        {
            path: '/partner/moneyDetail',
            name: 'moneyDetail',
            component: moneyDetail,
        },
        {
            path: '/partner/channel',
            name: 'channel',
            component: channel,
        },
        {
            path: '/partner/channelDetail',
            name: 'channelDetail',
            component: channelDetail,
        },
        {
            path: '/partner/user',
            name: 'user',
            component: user,
        },
        {
            path: '/partner/userLoan',
            name: 'userLoan',
            component: userLoan,
        },
        {
            path: '/partner/companyDetail',
            name: 'companyDetail',
            component: companyDetail,
        },
        {
            path: '/partner/questionList',
            name: 'questionList',
            component: questionList,
        },
        {
            path: '/partner/companyPrimaryDetail',
            name: 'companyPrimaryDetail',
            component: companyPrimaryDetail,
        },
        {
            path: '/partner/companyPrimaryDetailEdit',
            name: 'companyPrimaryDetailEdit',
            component: companyPrimaryDetailEdit,
        },
        {
            path: '/partner/equityList',
            name: 'equityList',
            component: equityList,
        },
        {
            path: '/partner/stockList',
            name: 'stockList',
            component: stockList,
        },
        {
            path: '/partner/businessPlan',
            name: 'businessPlan',
            component: businessPlan,
        },
        {
            path: '/loan/product',
            name: 'product',
            component: product,
        },
        {
            path: '/loan/productEdit',
            name: 'productEdit',
            component: productEdit,
        },
        {
            path: '/loan/productDetail',
            name: 'productDetail',
            component: productDetail,
        },
        {
            path: '/check/firstCheck',
            name: 'firstCheck',
            component: firstCheck,
        },
        {
            path: '/check/firstCheckEdit',
            name: 'firstCheckEdit',
            component: firstCheckEdit,
        },
        {
            path: '/check/firstCheckDetail',
            name: 'firstCheckDetail',
            component: firstCheckDetail,
        },
        {
            path: '/check/availableOrder',
            name: 'availableOrder',
            component: availableOrder,
        },
        {
            path: '/check/availableOrderDetail',
            name: 'availableOrderDetail',
            component: availableOrderDetail,
        },
        {
            path: '/check/sentOrder',
            name: 'sentOrder',
            component: sentOrder,
        },
        {
            path: '/check/sentOrderDetail',
            name: 'sentOrderDetail',
            component: sentOrderDetail,
        },
        {
            path: '/check/afterLoan',
            name: 'afterLoan',
            component: afterLoan,
        },
        {
            path: '/material/list',
            name: 'list',
            component: list,
        },
        {
            path: '/materialListDetail',
            name: 'materialListDetail',
            component: materialListDetail,
        },
        {
            path: '/operate/bannerSet',
            name: 'bannerSet',
            component: bannerSet,
        },
        {
            path: '/operate/bannerEdit',
            name: 'bannerEdit',
            component: bannerEdit,
        },
        {
            path: '/system/roleSet',
            name: 'roleList',
            component: roleList,
        },
        {
            path: '/system/userSet',
            name: 'accountList',
            component: accountList,
        },
        // {
        //     path: '/system/roleList',
        //     name: 'roleList',
        //     component: roleList,
        // },
        {
            path: '/system/roleEdit',
            name: 'roleEdit',
            component: roleEdit,
        },
        // {
        //     path: '/system/accountList',
        //     name: 'accountList',
        //     component: accountList,
        // },
        {
            path: '/system/accountEdit',
            name: 'accountEdit',
            component: accountEdit,
        },
        //   {
        //     path: '/partner/financeDetail',
        //     name: 'financeDetail',
        //     component: financeDetail,
        //   },
        {
            path: '/partner/financialInfo_v2',
            name: 'financialInfo_v2',
            component: financialInfoV2,
            children: [{
                    path: '/partner/financialInfo_v2/financialReportAnalysis',
                    name: 'financialReportAnalysis',
                    component: financialReportAnalysis
                }, {
                    path: '/partner/financialInfo_v2/financialBalance',
                    name: 'financialBalance',
                    component: financialBalance
                }, {
                    path: '/partner/financialInfo_v2/financialProfit',
                    name: 'financialProfit',
                    component: financialProfit
                }, {
                    path: '/partner/financialInfo_v2/financialCashflow',
                    name: 'financialCashflow',
                    component: financialCashflow
                },
                {
                    path: '/partner/financialInfo_v2/financialOther',
                    name: 'financialOther',
                    component: financialOther
                }
            ]
        }, {
            path: '/partner/financialInfo_v2/financialBalanceEdit',
            name: 'financialBalanceEdit',
            component: financialBalanceEdit
        }, {
            path: '/partner/financialInfo_v2/financialReportAnalysisEdit',
            name: 'financialReportAnalysisEdit',
            component: financialReportAnalysisEdit
        }, {
            path: '/partner/financialInfo_v2/financeOperatingEdit',
            name: 'financeOperatingEdit',
            component: financeOperatingEdit
        }, {
            path: '/partner/financialInfo_v2/financeInfoEdit',
            name: 'financeInfoEdit',
            component: financeInfoEdit
        },
    ]
})